package asf.transitions
{
	import asf.interfaces.ITransition;
	import asf.utils.FX;

	public class BasicFadeTransition implements ITransition
	{
		public function BasicFadeTransition( )
		{
		}

		public function start( p_transition:Transition ):void
		{
			var trans:Transition = p_transition;
			
			trans.nextView.alpha = 0;
			
			trans.notifyStart( );
			
			if( trans.hasCurrentView )
			{
				FX.fadeOut( trans.currentView ).queue( FX.fadeIn, trans.nextView, 400 ).queue( trans.notifyComplete );
			}
			else
			{
				FX.fadeIn( trans.nextView, 400 ).queue( trans.notifyComplete );
			}
		}
		
		public function dispose( ):void
		{
			
		}
	}
}